//  this library.
// import 'dart:mirrors';
import 'package:json_annotation/json_annotation.dart';

part 'hot_share.g.dart';

// void setProperty(Object obj, String propertyName, dynamic value) {
//   InstanceMirror instanceMirror = reflect(obj);
//   instanceMirror.setField(Symbol(propertyName), value);
// }

// flutter pub run build_runner build
@JsonSerializable()
class HotSharedModel {
  int? id;
  String? title;
  String? content;
  int? order;
  bool? delete;

  //  DateFormat('yyyy-MM-dd HH:mm:ss')  DateTime
  String? createTime;
  String? updateTime;
  int? viewCount;
  HotSharedModel({
    this.id,
    this.title,
    this.content,
    this.order,
    this.delete,
    this.createTime,
    this.updateTime,
    this.viewCount,
  });

  // 从 JSON 创建对象
  factory HotSharedModel.fromJson(Map<String, dynamic> json) => _$HotSharedModelFromJson(json);

  // 将对象转换为 JSON
  Map<String, dynamic> toJson() => _$HotSharedModelToJson(this);
}
